package com.dsbj.it.DingTalkBotStarter.util;

import com.dsbj.it.DingTalkBotStarter.common.enums.FieldTypeEnum;

public class TypeUtil {

    public static Object getType(FieldTypeEnum code, String data){
        switch (code) {
            case STRING:
            {
                return data;
            }
            case INTEGER:
            {
                return Integer.parseInt(String.valueOf(data));
            }
            case DOUBLE:
            {
                return Double.parseDouble(String.valueOf(data));
            }
            default:
                break;
        }
        return null;
    }
}
